#include "freshpoint.h"

namespace fireplane
{
	FreshPointBase::FreshPointBase()
	{}
	FreshPointBase::FreshPointBase(int id, CCPoint pos)
	{
		_id = id;
		_pos = pos;
	}
	FreshPointBase::~FreshPointBase(){}

	void FreshPointBase::InitFreshPoint(int id, CCPoint pos)
	{
		FreshPointBase *fp = new FreshPointBase(id,pos);

		_all_freshpoint_list.push_back(fp);
	}

	void FreshPointBase::UpdateAllFreshPoint( float dt )
	{
		list<FreshPointBase*>::iterator it = _all_freshpoint_list.begin();
		for (;it != _all_freshpoint_list.end();)
		{
			FreshPointBase* fp = *it;
			if (!fp->updateState(dt))
			{
				free(fp);
				it = _all_freshpoint_list.erase(it);
			}
			else
			{
				it++;
			}
		}
	}

	bool FreshPointBase::updateState( float dt )
	{
		return true;
	}

	list<FreshPointBase*> FreshPointBase::_all_freshpoint_list;
}